package pcsr.drivers.nxtDriver;

enum NXTActuatorRunState {
	IDLE( 0x00 ), 
	RAMPUP( 0x10 ), 
	RUNNING( 0x20 ), 
	RAMPDOWN( 0x40 );
	
	private int runStateValue;
	
	private NXTActuatorRunState( int value )
	{/*
		if(value < 0 || value > 3)
		{
			throw new IllegalArgumentException("NXTActuatorRunState values between 0 and 3.");
		}*/
		runStateValue = value;
	}
	
	public int GetRunStateValue( )
	{
		return runStateValue;
	}
	
	
	public static NXTActuatorRunState GetRunStateByValue( final int value )
	{
		switch (value) 
		{
			case 0x00:
				return IDLE;
			case 0x10:
				return RAMPUP;
			case 0x20:
				return RUNNING;
			case 0x40:
				return RAMPDOWN;
		}
		return null;
	}
	
	
}
